package restful;


public class PownceLikeProtocol extends RestfulProtocol {
	public PownceLikeProtocol() {
		namespace("http://api.pownce.com/2.0");

		topic("Posting");

		resource("Send To List");
		{
			GET("http://api.pownce.com/2.0/send/send_to.{format}");
			auth("HTTP basic").or().auth("OAuth");
			accomplish("Get a the list of potential recipients for the authenticated user. Includes options for the public, all friends, sets, and individual friends.");

			require().parameter("format").that("is The expected response format. Options are <b>xml</b>, or <b>json</b>.");
			require().parameter("app_key").that("is The application key assigned during registration. Not required for OAuth.");

			note("The <box>selected</box> parameter that is returned is the user's preference for their default \"send to\" option and developers should respect this preference.");
			note("The list of potential recipients is unordered.");
			note("Files cannot be sent to \"the public\" so you should gracefully omit this option when the user goes to post a file.");

			example("http://api.pownce.com/2.0/send/send_to.json");
			example("http://api.pownce.com/2.0/send/send_to.xml");
		}

		resource("Post a Message");
		{
			POST("http://api.pownce.com/2.0/send/message.{format}");
			auth("HTTP basic").or().auth("OAuth");
			accomplish("Post a note that contains only a message.");

			require().parameter("format").that("is The expected response format. Options are <b>xml</b>, or <b>json</b>.");
			require().parameter("app_key").that("is The application key assigned during registration. Not required for OAuth.");

			require().parameter("note_to").that("is The recipient(s) of the note. Options are <b>public</b>, <b>all</b>, <b>friend_x</b>, or <b>set_x</b>. Available options for the authenticated user can be found from the Send To List endpoint.");
			require().parameter("note_body").that("is The main text body of the note.");

			note("Returns the note that was posted in the requested response format.");

			example("http://api.pownce.com/2.0/send/message.json");
			example("http://api.pownce.com/2.0/send/message.xml");
		}

		resource("Post a Link");
		{
			POST("http://api.pownce.com/2.0/send/link.{format}");
			auth("HTTP basic").or().auth("OAuth");
			accomplish("Post a note that contains a link.");

			require().parameter("format").that("is The expected response format. Options are <b>xml</b>, or <b>json</b>.");
			require().parameter("app_key").that("is The application key assigned during registration. Not required for OAuth.");

			require().parameter("note_to").that("is The recipient(s) of the note. Options are <b>public</b>, <b>all</b>, <b>friend_x</b>, or <b>set_x</b>. Available options for the authenticated user can be found from the Send To List endpoint.");
			require().parameter("url").that("is The full url for the link. Ex: <box>http://pythong.org</box>");

			optional().parameter("note_body").that("is The main text body of the note.");

			note("Returns the note that was posted in the requested response format.");

			example("http://api.pownce.com/2.0/send/link.json");
			example("http://api.pownce.com/2.0/send/link.xml");
		}

		resource("Post an Event");
		{
			POST("http://api.pownce.com/2.0/send/event.{format}");
			auth("HTTP basic").or().auth("OAuth");
			accomplish("Post a note that contains an event.");

			require().parameter("format").that("is The expected response format. Options are <b>xml</b>, or <b>json</b>.");
			require().parameter("app_key").that("is The application key assigned during registration. Not required for OAuth.");

			require().parameter("note_to").that("is The recipient(s) of the note. Options are <b>public</b>, <b>all</b>, <b>friend_x</b>, or <b>set_x</b>. Available options for the authenticated user can be found from the Send To List endpoint.");
			require().parameter("event_name").that("is Name of the event.");
			require().parameter("event_location").that("is Location of the event.");
			require().parameter("event_date").that("is Date of the event in the format YYYY-MM-DD hh:mm. Ex: <box>2008-01-16 20:00</box>.");

			optional().parameter("note_body").that("is The main text body of the note.");

			note("Returns the note that was posted in the requested response format.");
			note("Event date seconds will be ignored.");

			example("http://api.pownce.com/2.0/send/event.json");
			example("http://api.pownce.com/2.0/send/event.xml");
		}

		resource("Post a File");
		{
			POST("http://api.pownce.com/2.0/send/file.{format}");
			auth("HTTP basic").or().auth("OAuth");
			accomplish("Post a note that contains a file.");

			require().parameter("format").that("is The expected response format. Options are <b>xml</b>, or <b>json</b>.");
			require().parameter("app_key").that("is The application key assigned during registration. Not required for OAuth.");

			require().parameter("note_to").that("is The recipient(s) of the note. Options are <b>public</b>, <b>all</b>, <b>friend_x</b>, or <b>set_x</b>. Available options for the authenticated user can be found from the Send To List endpoint.");
			require().parameter("media_file").that("is The data of the file");

			optional().parameter("note_body").that("is The main text body of the note.");

			note("Returns the note that was posted in the requested response format.");
			note("Users with pro accounts may upload larger files. Please use the url <box>http://api.pownce.com/2.0/send/file_pro</box> for pro user file uploads.");
			note("The file size limit will be respected server-side, so please make the limit clear to users.");
			note("For OAuth requests, put the OAuth-specific parameters in the header or url, not the post body. For now this is the best way to keep the file data separate from the url encoded parameters.");

			example("http://api.pownce.com/2.0/send/file.json");
			example("http://api.pownce.com/2.0/send/file.xml");
		}

		resource("Post a Reply");
		{
			POST("http://api.pownce.com/2.0/send/reply.{format}");
			auth("HTTP basic").or().auth("OAuth");
			accomplish("Post a reply to a note.");

			require().parameter("format").that("is The expected response format. Options are <b>xml</b>, or <b>json</b>.");
			require().parameter("app_key").that("is The application key assigned during registration. Not required for OAuth.");

			require().parameter("reply_to").that("is The recipient(s) of the note. Options are <b>public</b>, <b>all</b>, <b>friend_x</b>, or <b>set_x</b>. Available options for the authenticated user can be found from the Send To List endpoint.");

			optional().parameter("note_body").that("is The main text body of the note.");
			optional().parameter("stars").that("is The main text body of the note.");
			optional().parameter("rsvp").that("is The main text body of the note.");

			note("Returns the note that was posted in the requested response format with replies.");
			note("If no <box>stars</box> or <box>rsvp</box> POST parameter is present, then the <box>note_body</box> is required.");

			example("http://api.pownce.com/2.0/send/reply.json");
			example("http://api.pownce.com/2.0/send/reply.xml");
		}
	}
}
